*Paper: "The Gender Promotion Gap: Evidence from Central Banking" (RESTAT MS 22860)
*File: Descriptives.do
*Authors: Laura Hospido (laura.hospido@bde.es) & Luc Laeven (Luc.laeven@ecb.int) & Ana Lamo (ana.lamo@ecb.int)
*This version: October 2020
*---------------------------------------------------------------------------

clear all
set more off
global master_ECB `""D:\Data""' /*to be changed by the user*/
cd $master_ECB

sysdir set PLUS "D:\ado\plus" /*to be changed by the user*/

capture log close
log using "Table1.log", replace

**---------------------------------------------------------------------------
**  Table 1: Descriptives statistics 
**---------------------------------------------------------------------------

*******************************************
*** Dataset 1: Working histories 2002-2017
*******************************************

import delimited profiles, case(preserve) clear
run labels1.do

tab female,m
bys pid: gen n=_n
tab female if n==1,m

bys female: sum age_round
regress age_round female

tab salaryband,m
bys salaryband: tab female,m

tab salaryband,gen(band)

sum steptotal
bys female: sum steptotal
regress steptotal female
sum steptotal if band1==1
bys female:sum steptotal if band1==1
regress steptotal female if band1==1

sum mtenure
bys female: sum mtenure
regress mtenure female

sum children
regress children female

***Promotions 

/*dropping those who are Principal experts or Advisors (band H and I )but were not promoted during the time sample*/

keep if sample_promotions==1 

sum Perpromotion
bys female: sum Perpromotion
regress Perpromotion female

sum Perpromotion if year<2011
bys female: sum Perpromotion  if year<2011
regress Perpromotion female if year<2011

sum Perpromotion if year>=2011
bys female: sum Perpromotion  if year>=2011
regress Perpromotion female if year>=2011

sum y2_topPerf
bys female: sum y2_topPerf
regress y2_topPerf female

sum y2_topPerf if year<2011
bys female: sum y2_topPerf if year<2011
regress y2_topPerf female if year<2011

sum y2_topPerf if year>=2011
bys female: sum y2_topPerf if year>=2011
regress y2_topPerf female if year>=2011

sum y2_bonus
bys female: sum y2_bonus 
regress y2_bonus female

sum y2_bonus if year<2011
bys female: sum y2_bonus  if year<2011
regress y2_bonus female if year<2011

sum y2_bonus if year>=2011
bys female: sum y2_bonus  if year>=2011
regress y2_bonus female if year>=2011

sum y2_mentee
bys female: sum y2_mentee
regress y2_mentee female

sum y2_mentee if year<2011
bys female: sum y2_mentee if year<2011
regress y2_mentee female if year<2011

sum y2_mentee if year>=2011
bys female: sum y2_mentee if year>=2011
regress y2_mentee female if year>=2011

sum sumMatAdop
bys female: sum sumMatAdop
regress sumMatAdop female

sum sumMatAdop if year<2011
bys female: sum sumMatAdop if year<2011
regress sumMatAdop female if year<2011

sum sumMatAdop if year>=2011
bys female: sum sumMatAdop if year>=2011
regress sumMatAdop female if year>=2011

sum sumPLeave
bys female: sum sumPLeave
regress sumPLeave female

sum sumPLeave if year<2011
bys female: sum sumPLeave if year<2011
regress sumPLeave female if year<2011

sum sumPLeave if year>=2011
bys female: sum sumPLeave if year>=2011
regress sumPLeave female if year>=2011

********************************************
*** Dataset 2: Promotion campaigns 2012-2017
********************************************

import delimited campaigns, case(preserve) clear
run labels2.do

gen offer_candidate=offer
replace offer_candidate=. if candidate==0

tab female,m
tab candidate,m
tab female if candidate==1,m
tab offer_candidate
tab female if offer_candidate==1,m
regress offer_candidate female
tab offer
regress offer female

sum mtenure if candidate==1
bys female: sum mtenure if candidate==1
regress mtenure female if candidate==1
sum mtenure 
bys female: sum mtenure
regress mtenure female

sum y2_topPerf if candidate==1
bys female: sum y2_topPerf if candidate==1
regress y2_topPerf female if candidate==1
sum y2_topPerf 
bys female: sum y2_topPerf
regress y2_topPerf female

sum y2_bonus if candidate==1
bys female: sum y2_bonus if candidate==1
regress y2_bonus female if candidate==1
sum y2_bonus
bys female: sum y2_bonus 
regress y2_bonus female

sum y2_mentee if candidate==1
bys female: sum y2_mentee if candidate==1
regress y2_mentee female if candidate==1
sum y2_mentee
bys female: sum y2_mentee 
regress y2_mentee female

sum HHallowance if candidate==1
bys female: sum HHallowance if candidate==1
regress HHallowance female if candidate==1
sum HHallowance
bys female: sum HHallowance
regress HHallowance female

sum children if candidate==1
bys female: sum children if candidate==1
regress children female if candidate==1
sum children
bys female: sum children 
regress children female

sum com100 if candidate==1
bys female: sum com100 if candidate==1
regress com100 female if candidate==1
sum com100
bys female: sum com100
regress com100 female

sum Ducom100F  if candidate==1
bys female: sum Ducom100F  if candidate==1
regress Ducom100F  female if candidate==1
sum Ducom100F 
bys female: sum Ducom100F  
regress Ducom100F  female

capture log close
log using "TableA2.log", replace

**---------------------------------------------
**  Table A2: Descriptives statistics at entry 
**----------------------------------------------

* 2003-2017 *

import delimited profiles, case(preserve) clear
run labels1.do
keep if entry==1
tab female,m

sum age_round
bys female: sum age_round
regress age_round female

sum steptotal
bys female: sum steptotal
regress steptotal female

sum children
bys female: sum children
regress children female

* Entry before 2011 *

import delimited profiles, case(preserve) clear
run labels1.do
keep if entry==1
keep if year<2011
tab female,m

sum age_round
bys female: sum age_round
regress age_round female

sum steptotal
bys female: sum steptotal
regress steptotal female

sum children
bys female: sum children
regress children female

* Entry from 2011 *

import delimited profiles, case(preserve) clear
run labels1.do
keep if entry==1
keep if year>=2011
tab female,m

sum age_round
bys female: sum age_round
regress age_round female

sum steptotal
bys female: sum steptotal
regress steptotal female

sum children
bys female: sum children
regress children female

log close 
